package com.wesley.service;

import com.wesley.dao.UserDao;
import com.wesley.entity.User;
import com.wesley.feign.TestServer2Feign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * created by wei xin on 2020/3/3 0003
 */
@Service
public class UserService {

    @Autowired
    private UserDao userDao;

    @Autowired
    private TestServer2Feign testServer2Feign;


//    @GlobalTransactional
//    @Transactional
    public void saveUser(String name) {
        userDao.save(new User(name));
        testServer2Feign.saveAdmin();
        int tag =  100 / 0;
    }


    public Map showMsg() {
        testServer2Feign.showMsg();
        Map result = new HashMap(1);
        result.put("result","OK");
        return result;
    }






}
